<%@ page import="java.util.ArrayList" %>
<%@ page import="com.zhiyou.entity.Column" %><%--
  Created by IntelliJ IDEA.
  User: 磊布斯
  Date: 2021/9/1
  Time: 15:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <meta charset="utf-8">
    <link href="../css/main.css" rel="stylesheet">
</head>
<body>
<%--获取栏目--%>
<%
    ArrayList<Column> columnList = (ArrayList<Column>) session.getAttribute("columnList");
    String addNews = (String) session.getAttribute("addNews");
    if ("success".equals(addNews)){
        %>
    <script type="text/javascript">
        alert("发布成功!")
    </script>
<%
    }
    session.removeAttribute("addNews");
%>
<!-- 新闻管理 -->
<div class="AccountManagement_c" id="NewsManagement_c">
    <h3>新闻管理
        <div class="amcl fr">
            <select class="fl NewsManagement_search">
                <%
                    for (int i = 0; i < columnList.size() ; i++) {
                        %>
                <option><%=columnList.get(i).getName()%></option>
                <%
                    }
                %>
            </select>
            <input type="text" placeholder="用户名" class="fl" name="">
            <div class="search fl"><img src="../images/search.png"></div>
        </div>
    </h3>
    <div class="list" id="release_news">
        <ul class="list_h">
            <li class="b80"><label>发布新闻</label></li>
        </ul>
        <form action="../DoAddNews" method="post">
            <div class="list_b_c" id="release_news_in">
                <div class="release_news">
                    <div class="news_title">
                        <label class="text_center">标题</label>
                        <input type="text" placeholder="填写标题" name="textTitle">
                    </div>
                    <div class="column_name">
                        <label class="text_center">栏目</label>
                        <select class="column_name_release" name="selectColumn">
                            <%
                                for (int i = 0; i < columnList.size() ; i++) {
                            %>
                            <option value="<%=columnList.get(i).getCid()%>"><%=columnList.get(i).getName()%></option>

                            <%
                                }
                            %>
                        </select>
                    </div>
                    <textarea class="release_news_content" rows="50" cols="60" placeholder="编辑正文" name="textDesc"></textarea>
                    <button class="release_news_ok_btn text_center">发<i>我</i>布</button>
                </div>
            </div>
        </form>

    </div>
</div>
</body>
</html>
